/**
 * ===========================================================================
 * 版权所有 湖南免了么网络科技有限公司，并保留所有权利。
 * 网站地址: http://www.mianle.me
 * ===========================================================================
 * 11:36 2018/6/19
 */
package com.mianle.userapi.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @Author: yiyuan
 * @Description:
 * @Date: Created in 11:36 2018/6/19
 *
 */
@Configuration
public class WebStaticResourceConfig extends WebMvcConfigurerAdapter {

    @Autowired
    private ResourceConfig resourceConfig;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/**").addResourceLocations("file:"+resourceConfig.getUploadPath());
        super.addResourceHandlers(registry);
    }
}
